<html ng-app="app">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="../../build/common/base.css" rel="stylesheet">
	<script type="text/javascript" src="../../build/common/base.js"></script>
	<script type="text/javascript" src="../../build/common/ngEdit.js"></script>
	<script type="text/javascript">
	var id = $.getParam("id");
	
	var app = angular.module('app', ['baseDirective']);
	app.controller("ctrl", [ '$scope', 'baseService','ArrayToolService', function($scope, baseService,ArrayToolService) {
		$scope.save = function(){
			var userMsg = $scope.userMsg;
			userMsg.id = $scope.data.id;
			if(!userMsg.newPassword || userMsg.newPassword !== userMsg.newPassword1){
				$.Toast.warning("两次输入密码不一致！");
				return;
			}
			if(!userMsg.oldPassword){
				$.Toast.warning("请输入原密码！");
				return;
			}
			
		var defer = baseService.postForm(__ctx+"/org/user/updateUserPassWorld",userMsg);
			$.getResultMsg(defer,function(){
			},function(){
				
			});
		}
	}]);
	</script>
</head>
<body class="panel success" ng-controller="ctrl">
	<!-- 顶部按钮 -->
	<div class="panel-heading">
		<a class="btn btn-primary fa-save" ng-click="save()"> 提交 </a>
	</div>
	<form name="form" method="post" ab-load="/org/user/get?id={id}"  ng-model="data">
		<table class="form-table" cellspacing="0">
			<tr>
				<th>
					<span>姓名:</span>
				</th>
				<td>
					{{data.fullname}}
				</td>

			</tr>
			<tr>
				<th>
					<span>账号:</span>
				</th>
				<td>
					{{data.account}}
				</td>
			</tr>

			<tr>
				<th>
					<span>原密码:</span>
					<span class="required">*</span>
				</th>
				<td>
					<input class="form-control" type="password" ng-model="userMsg.oldPassword" ab-validate="{required:true,maxlength:192}" />
				</td>
			</tr>
			
			<tr>
				<th>
					<span>新密码:</span>
					<span class="required">*</span>
				</th>
				<td>
					<input class="form-control" type="password" ng-model="userMsg.newPassword" ab-validate="{required:true,maxlength:192}" />
				</td>
			</tr>
			
			<tr>
				<th>
					<span>确认密码:</span>
					<span class="required">*</span>
				</th>
				<td>
					<input class="form-control" type="password" ng-model="userMsg.newPassword1" ab-validate="{required:true,maxlength:192}" />
				</td>
			</tr>
			
		</table>
	</form>
</body>
</html>